<include file="Public/head"/>
<css href="__PUBLIC__/qwadmin/css/bootstrap-datetimepicker.min.css"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>
            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                     <div class="cf">
                            <form class="form-inline" action="" method="get">
                                <label class="inline">请选择时间段：</label>
                                <input type="text" class="form-control datetimeStart" readonly  value="{$dateS|date='Y-m-d',###}"/>
                                &nbsp;-&nbsp;
                                <input type="text" class="form-control datetimeEnd" readonly  value="{$dateE|date='Y-m-d',###}"/>
                                
                                <label class="inline">请选择支付类型</label>
                                <select name="pay_type" class="pay_type" class="form-control">
                                    <option value="0" <if condition=" I('get.pay_type') eq 0 ">selected="selected"</if> >全部</option>
                                    <option value="1" <if condition=" I('get.pay_type') eq 1 ">selected="selected"</if>>线上</option>
                                    <option value="2" <if condition=" I('get.pay_type') eq 2 ">selected="selected"</if>>线下</option>
                                </select>
                                
                                <button type="button" onclick="sou()" class="btn btn-purple btn-sm">
                                    <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                                   		 搜索
                                </button>
                                <button type="button"  class="btn btn-purple btn-sm pri" >
                                    <span class="ace-icon fa fa-print icon-on-right bigger-110"></span>
                                   		 打印
                                </button>
                            </form>
                        </div>
                         <h2 class=" text-center">财务列表页</h2>
                    <div class="space-4"></div>
                      <table class="table table-striped table-bordered" >
                            <thead>
                            <tr>
                            	<th class="center" style='width:30%'>时间段</th>
                                <th class="center">科目</th>
                                <th class="center">金额（单位：元）</th>
                                <th class="center">操作</th>
                            </tr>
                            </thead>
                            <tbody>

               					<?php if(!empty($meetingPrice) or !empty($signPrice)) { ?>
                                 <tr>
                                 	<td rowspan='3' class='center'>{$dateS|date='Y-m-d',###}&nbsp;至&nbsp;{$dateE|date='Y-m-d',###}</td>
                                    <td class="center">预约学车</td>
 									<td class="center">
 									<?php if($meetingPrice){ ?>
 									{$meetingPrice}
 									<?php }else{?>
 									/
 									<?php  }?>
 									</td>
                                    <td class="center"><a href="<?php echo U('Record/details',array('pay_type'=>I('get.pay_type'),'dateS'=>$dateS,'dateE'=>$dateE,'type'=>1));?>"><i
                                            class="ace-icon fa fa-pencil bigger-100"></i>详情</a>
                                     </td>
                                </tr>
                               
                                <tr>
                                	
                                    <td class="center">在线报名</td>
 									<td class="center">
 									
	 									<?php if($signPrice){ ?>
	 									{$signPrice}
	 									<?php }else{?>
	 									/
	 									<?php  }?>
 									</td>
                                    <td class="center"><a href="<?php echo U('details',array('pay_type'=>I('get.pay_type'),'dateS'=>$dateS,'dateE'=>$dateE,'type'=>2));?>"><i
                                            class="ace-icon fa fa-pencil bigger-100"></i>详情</a>
                                     </td>
                                </tr>
                                <tr>
                                    <td colspan ='4' align="right">当前时间段合计：{$meetingPrice+$signPrice} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                    
                                </tr>
                                <?php  }else{ ?>
                                	<tr>
                                	 	<td colspan ='4' align="center" style='color:red;'>当前时间段没有资金收入！</td>
                                	 </tr>
                                <?php }?>
                            </tbody>
                        </table>
                    {$page}
                    <!-- PAGE CONTENT ENDS -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.page-content -->
    </div>
</div><!-- /.main-content -->
<include file="Public/footer"/>

</div><!-- /.main-container -->
<script src="__PUBLIC__/qwadmin/js/jquery-1.9.1.min.js"></script>
<script src="__PUBLIC__/qwadmin/js/bootstrap-datetimepicker.js"></script>
<script src="__PUBLIC__/qwadmin/js/bootstrap-datetimepicker.zh-CN.js"></script>
<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script type="text/javascript">
$(".datetimeStart").datetimepicker({
    format: 'yyyy-mm-dd',
    minView:'month',
    language: 'zh-CN',
    autoclose:true
}).on("click",function(){
    $(".datetimeStart").datetimepicker("setEndDate",$(".datetimeEnd").val())
});

$(".datetimeEnd").datetimepicker({
    format: 'yyyy-mm-dd',
    minView:'month',
    language: 'zh-CN',
    autoclose:true
}).on("click",function(){
    $(".datetimeEnd").datetimepicker("setStartDate",$(".datetimeStart").val())
});

function sou(){
    var dateS = $('.datetimeStart').val();
    var dateE = $('.datetimeEnd').val();
    var name = $('#name').val();
    var id = $('#id').val();
    var pay_type = $('.pay_type').val();
    //return;
    var param = '';
    if(dateS){
        param += '/dateS/'+dateS;
        if(dateE ==''){
        	alert('请选择结束时间');
        	return false;
        }else{
        	param += '/dateE/'+dateE;
        }
    }
    if(pay_type){
    	param +='/pay_type/'+pay_type;
    }
    if(id){
        param += '/id/'+id; 
    }
    if(name){
        param += '/name/'+name; 
    }

    location.href="__APP__/Admin/Record/index"+param+".html";
}

$('.pri').on('click',function(){
	var dateS = $('.datetimeStart').val();
    var dateE = $('.datetimeEnd').val();
    var name = $('#name').val();
    var id = $('#id').val();
    //return;
    var param = '/type/2';
    if(dateS){
        param += '/dateS/'+dateS;
        if(dateE ==''){
        	alert('请选择结束时间');
        	return false;
        }else{
        	param += '/dateE/'+dateE;
        }
    }
    if(id){
        param += '/id/'+id; 
    }
    if(name){
        param += '/name/'+name; 
    }
    location.href="__APP__/Admin/Record/index"+param+".html";
})




</script>
</body>
</html>
